<?php


namespace TbfDatabase\MysqlAST;


class AndWhereCondition implements WhereCondition{
    /** @var  Condition[] */
    protected $conditionList;
    function __construct(array $conditionList){
        $this->conditionList = $conditionList;
    }
    function Copy(){
        return new AndWhereCondition($this->conditionList);
    }
    function GetText(){
        return ASTUtil::joinNode($this->conditionList,' AND ');
    }

    /** @return PreparedText */
    function GetPrepareParameter(){
        return ASTUtil::JoinPreparedNode($this->conditionList);
    }
    function AddPrepare($text,$parameters=array()){
        $this->conditionList[] = Sql::prepare($text,$parameters);
    }
    function IsEmpty(){
        return empty($this->conditionList);
    }
}